package com.app.couponsharelife.utils

import android.content.Context
import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram
import com.tencent.mm.opensdk.openapi.WXAPIFactory


/**
 *Created by xct on 2019/4/3
 *Description:拉起微信小程序
 */
object WXMiniProgramUtil {
    fun start(context:Context){
        val appId = "wx9a61066601a2432c" // 填应用AppId
        val api = WXAPIFactory.createWXAPI(context, appId)
        val req = WXLaunchMiniProgram.Req()
        req.userName = "gh_f3212ecea7cb" // 填小程序原始id
        req.path = "pages/index/index"                  //拉起小程序页面的可带参路径，不填默认拉起小程序首页
        req.miniprogramType = WXLaunchMiniProgram.Req.MINIPTOGRAM_TYPE_RELEASE// 可选打开 开发版，体验版和正式版
        api.sendReq(req)
    }
}